const app = document.getElementsByClassName("app-bg")[0];

switch_bg(0);

function switch_bg(num) {
    if (num > 3) {
        num = 0;
    }
    app.style.backgroundImage = "url(/static/img/p" + num + ".png)";
    app.classList.add("fadeIn", 'slow');
    setTimeout(function () {
        app.classList.remove("fadeIn", 'slow');
    }, 2000);
    num++;
    setTimeout(function () {
        switch_bg(num);
    }, 8000);
}

